package com.efivestar.idm.api.service.lock.protocol.handler;

import com.efivestar.idm.api.common.Cons;
import com.efivestar.idm.api.util.ByteUtils;
import io.netty.buffer.ByteBuf;
import org.springframework.stereotype.Service;

/**
 * IMEI和ICCID对应指令
 * <p>
 * 作用：在业务表中生成IMEI和ICCIDd的对应关系
 */
@Service
public class ImeiIccidProtocolHandler extends AbstractLockProtocolHandler {

    /**
     * @param buf
     * @param lockId
     * @return
     */
    @Override
    public byte[] handleData(ByteBuf buf, String lockId) {
        return ByteUtils.hexToBytes("01");
    }

    @Override
    protected int getDataLenthWithoutDeviceId() {
        return 1;
    }

    @Override
    public String udpHead() {
        return Cons.UDP_HEAD_EF01;
    }

    @Override
    public String udpCommand() {
        return Cons.UDP_COMMAND_IMEI_ICCID;
    }

}






